import {createRouter, createWebHistory} from "vue-router";

const router = createRouter({
    history:createWebHistory(),  //路由历史
    //路由路径和组件
    routes:[

        {
            path:'/',
            component: () => import("@/view/LoginPageView.vue")

        },
        {
            path:'/login',
            component: () => import("@/view/LoginPageView.vue")
        },
        {
            path:'/hello',
            component: () => import("@/view/DashboardView.vue"),
            children:[
                {
                    path:'',
                    component: () => import("@/view/StatisticView.vue")

                },
                {
                    path:'user',
                    component: () => import("@/view/UserView.vue")
                },
                {
                    path:'user/:id',  //动态路由
                    component: () => import("@/view/UserDetailView.vue")
                },
                {
                    path:'marketActivity',
                    component: () => import("@/view/MarketActivityView.vue")
                },
                {
                    path:'marketActivity/:id',
                    component: () => import("@/view/MarketActivityDetailView.vue")
                },
                {
                    path:'clueControl',
                    component: () => import("@/view/ClueControlView.vue")
                },
                {
                    path:'clueDetails/:id',
                    component: () => import("@/view/ClueDetailView.vue")
                },
                {
                    path:'customer',
                    component: () => import("@/view/CustomerView.vue")
                },
                {
                    path:'customerDetail/:id',
                    component: () => import("@/view/CustomerDetailView.vue")
                },
                {
                    path:'tran',
                    component: () => import("@/view/TranManageView.vue")
                },
                {
                    path:'tranDetails/:id',
                    component: () => import("@/view/TranDetailView.vue")
                },
            ]
        }
    ]
})

export default router;